<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.google.android.gcm.server.*" %>

<%String callback = request.getParameter("callback");%>
<%=callback %>(<%
		String id = request.getParameter("id");
//String MESSAGE_ID = String.valueOf(Math.random() % 100 + 1);	//메시지 고유 ID

	//boolean SHOW_ON_IDLE = true;	//기기가 활성화 상태일때 보여줄것인지

	//int LIVE_TIME = 1;	//기기가 비활성화 상태일때 GCM가 메시지를 유효화하는 시간

	//int RETRY = 2;	//메시지 전송실패시 재시도 횟수
		
	
String regid = "APA91bFHOplyYVorNldXKS5WWFhhTZ-rcnwAiKXN-ZSINEuw7sh_I7LVvt_8P83O_L14cs_jeHdFbuy09AFBaTfQ7dbef38_s77Ck8PX8H42NJyakdd4YKONYfYZF6XrY-6PNjir1mFMzMenXu1ubJqboGYERP1w1w";
Sender sender = new Sender("AIzaSyC71UD8FmXiaATQ1FUv6fQalDzkMv4qBpg");
Message message = new Message.Builder()
		//.collapseKey(MESSAGE_ID)
		//.delayWhileIdle(SHOW_ON_IDLE)
		//.timeToLive(LIVE_TIME)
		.addData("msg","msg")
		.build();
Result result = sender.send(message, regid, 5);

if(result.getMessageId() != null) {
    
	out.print("gogo");
   }
   else {
      String error = result.getErrorCodeName(); 
	out.print(error);	
}

%>);